<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>我的订阅</title>

<!-- Bootstrap -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/font/font-awesome.min.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/common/common.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/icon/typicons.min.css">

<!-- Stylesheets -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/global/css/bootstrap-extend.min.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/assets/css/site.min.css">
<!-- Plugins -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/global/vendor/formvalidation/formValidation.css">
<!-- 校验form样式 -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/assets/examples/css/forms/validation.css">
<!-- form掩码 -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/assets/examples/css/forms/masks.css">
<!-- Fonts -->
<!-- 网络图标 -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/v2/global/fonts/web-icons/web-icons.min.css">
<script src="<%=request.getContextPath() %>/v2/global/vendor/breakpoints/breakpoints.js"></script>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script>
Breakpoints();
</script>
<style type="text/css">
.typcn {
	font-size: 16px;
}
	
</style>
</head>

<body class="my-bodyfix">
<div class="container">
	<div class="row">
	<div class="col-md-12">
		<div class="panel">
			<div class="panel-heading">
				<h3 class="panel-title">账号注册:</h3>
			</div>
			<div class="panel-body">
					<div class="row">
					<form id="add-user" autocomplete="off" method="post" action="<%=request.getContextPath()%>/login/register.action">
						<div class="col-lg-6 col-lmd-6 col-md-offset-3  form-horizontal">
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
									用户名<span class="required">*</span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<span class="input-group-addon"> <i class="icon wb-user" aria-hidden="true"></i> </span> 
										<input type="text" class="form-control" name="uname" placeholder="用户名" required="required">
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
								密码 <span class="required">*</span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<span class="input-group-addon"> <i class="icon wb-lock" aria-hidden="true"></i> </span> 
										<input type="password" class="form-control" name="upwd" 
											placeholder="密码" required="true">
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
								重复密码 <span class="required">*</span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<span class="input-group-addon"> <i class="icon wb-lock" aria-hidden="true"></i> </span> 
										<input type="password" class="form-control" name="repwd"
											placeholder="重复密码" required="true">
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
								Email <span class="required">*</span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<span class="input-group-addon"> <i
											class="icon wb-envelope" aria-hidden="true"></i>
										</span> <input type="email" class="form-control" name="email"
											placeholder="email@email.com" required="required">
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
								手机号 <span class="required">*</span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<span class="input-group-addon"> <i class="typcn typcn-phone" aria-hidden="true"></i> </span> 
										<input type="text" class="form-control" data-plugin="formatter"
											id="phone"	name="phone" data-pattern="+86 [[99999999999]]" required="true" />
										
									</div>
									<small id='phone-error' style="color:red;display: none" class="help-block">请输入正确位数的手机号!</small>
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-12 col-sm-3 text-left control-label">
								验证码<span class="required"></span>
								</label>
								<div class="col-lg-12 col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control" name="varify" placeholder="接收到的验证码,1分钟内有效">
										<span class="input-group-btn">
											<button onclick="addUser()" class="btn btn-primary">点击获取</button>
										</span>
									</div>
								</div>
								<div class="input-group">
								</div>
							</div>
						</div>
						<div class="form-group col-lg-12 text-center padding-top-m">
							<button type="button" onclick="addUser()" class="btn btn-primary" id="validateButton1">提交</button>
						</div>
					</form>
					</div>
			</div>
		</div>
	</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="<%=request.getContextPath() %>/js/bootstrap/bootstrap.min.js"></script>
<script src="<%=request.getContextPath() %>/js/common/jutil.js"></script>
<!-- ----------------Plugins -------->
<!-- 动画效果 form掩码 -->
<script src="<%=request.getContextPath() %>/v2/global/vendor/animsition/animsition.js"></script>
<script src="<%=request.getContextPath() %>/v2/global/vendor/formatter-js/jquery.formatter.js"></script>
<!-- 校验 -->
<script src="<%=request.getContextPath() %>/v2/global/vendor/formvalidation/formValidation.js"></script>
<script src="<%=request.getContextPath() %>/v2/global/vendor/formvalidation/framework/bootstrap.js"></script>
<!-- ----------------Plugins end-------->
<!-- Scripts -->
<script src="<%=request.getContextPath() %>/v2/global/js/core.js"></script>
<script src="<%=request.getContextPath() %>/v2/assets/js/site.js"></script>
<script src="<%=request.getContextPath() %>/v2/assets/js/sections/menubar.js"></script>

<!-- form掩码 -->
<script src="<%=request.getContextPath() %>/v2/global/js/components/animsition.js"></script>
<script src="<%=request.getContextPath() %>/v2/global/js/components/formatter-js.js"></script>

<script type="text/javascript">

(function(document, window, $) {
    'use strict';
    var Site = window.Site;
    $(document).ready(function() {
      Site.run();
    });
  })(document, window, jQuery);
	//取消订阅
	function cancelOrder(id){
		
	}
	
	(function() {
		// set up formvalidation
		$("#add-user").formValidation({
			framework : 'bootstrap',
			fields : {
				uname:{
					validators: {
						notEmpty: {
							message: '请输入该项的值!'
						},
						stringLength : {
							min : 5,
							max : 20,
							message : '请输入5-20个字符'
						},
						regexp : {
							regexp :/^[a-zA-Z0-9_]+$/,
							message : '只允许输入数字、字母和"_"的组合'
						}
					}
				},
				upwd:{
					validators: {
						notEmpty: {
							message: '请输入该项的值!'
						},
						stringLength : {
							min : 5,
							max : 20,
							message : '请输入5-20个字符'
						},
						regexp : {
							regexp : /^[a-zA-Z0-9]+$/,
							message : '只允许输入数字和字母的组合'
						}
					}
				},
				repwd:{
					validators: {
						notEmpty: {
							message: '请输入该项的值!'
						},
						stringLength : {
							min : 5,
							max : 20,
							message : '请输入5-20个字符'
						},
						identical : {
							field: 'upwd',
							message : '两次输入的密码不一致!'
						}
						
					}
				},
				email : {
					validators : {
						notEmpty: {
							message: '请输入该项的值!'
						},
						emailAddress : {
							message : '请输入正确格式的邮箱地址!'
						}
					}
				}
			}
		});
	})();
	
	function addUser(){
		if($("input[name='phone']").val().trim().length<15){
			alert("手机号码有误!");
		}else{
			jutil.ajax({
				url:"/login/uname_add_exist.action",
				data:{
					uname: $("input[name='uname']").val()
				},
				success:function(data){
					if(data.result){
						
						jutil.ajax({
							url:"/login/uname_add_exist.action",
							data:{
								uname: $("input[name='uname']").val(),
								upwd: $("input[name='upwd']").val(),
								email: $("input[name='email']").val(),
								phone: $("input[name='phone']").val(),
							},
							success:function(data){
									if(data.result){
										top.location.href="http://www.seeyou-again.cn/login_show"; 
									}
								}
							})
// 						document.getElementById("add-user").submit();
					}else{
						alert("用户名已经存在,请更换用户名");
					}
				}
			})
		}
	}
</script>
</body>

</html>
